﻿using MvcExtensions;

namespace BlankMvc.Types {
	public class UserRegister {
		public string UserName { get; set; }
		public string Email { get; set; }
		public string Password { get; set; }
		public string ConfirmPassword { get; set; }
	}

	public class UserRegisterMeta : ModelMetadataConfiguration<UserRegister> {
		public UserRegisterMeta() {
			Configure(x => x.UserName).Required().MinimumLength(4).MaximumLength(20).DisplayName("Логин");
			Configure(x => x.Email).Required().MinimumLength(8).MaximumLength(50).DisplayName("Email");
			Configure(x => x.Password).Required().MinimumLength(6).MaximumLength(13).DisplayName("Пароль");
			Configure(x => x.ConfirmPassword).Compare("Password").DisplayName("Подтверждение");
		}
	}
}
